package com.cjj.common.consts;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.*;

/**
 * @author baozhuangyu
 * @date 2021/4/30  16:55
 * 资产监控权限
 */
@Getter
@AllArgsConstructor
@ApiModel("资产监控权限码")
public enum ModuleRuleEnum {

    /**
     * 资产挖掘
     */
    ZCWJ_ZCPM(2, "zcwjzcpm", "资产挖掘-资产拍卖"),
    ZCWJ_TDSJ(29, "zcwjtdsj", "资产挖掘->土地数据"),
    ZCWJ_ZBZB(30, "zcwjzbzb", "资产挖掘->招标中标"),
    ZCWJ_DWQ(4, "zcwjdwq", "资产挖掘-代位权监控"),
    ZCWJ_JRZC(31, "zcwjjrzj", "资产挖掘->金融资产"),
    ZCWJ_DCDY(32, "zcwjdcdy", "资产挖掘->动产抵押"),
    ZCWJ_WXZC(41, "zcwjwxzc", "资产挖掘->无形资产"),
    ZCWJ_CJFZC(49, "zcwjcjfzc", "资产挖掘->查解封资产"),
    ZCWJ_GQZY(44, "zcwjgqzy", "资产挖掘->股权质押"),
    ZCWJ_CLXX(52, "zcwjclxx", "资产挖掘->车辆信息"),
    ZCWJ_BDCDJ(51, "zcwjbdcdj", "资产挖掘->不动产登记"),
    ZCWJ_DZB(57,"zcwjdzb","资产挖掘->电子报"),

    /**
     * 资产挖掘-在建工程
     */
    ZJGC_JSDW(54, "zjgcjsdw", "资产挖掘->在建工程->建设单位"),
    ZJGC_ZBDW(55, "zjgczbdw", "资产挖掘->在建工程->中标单位"),
    ZJGC_SGDW(56, "zjgcsgdw", "资产挖掘->在建工程->施工单位"),

    /**
     * 风险监控
     */
    FXJK_SSJK(39, "fxjkssjk", "风险监控-涉诉监控"),
    FXJK_SXJL(42, "jkxxsxjl", "风险监控->失信记录"),
    FXJK_QYPCCZ(40, "fxjkqypccz", "风险监控-企业破产重组"),
    FXJK_XZGXF(50, "fxjkxzgxf", "风险监控->限制高消费"),
    FXJK_ZBAJ(58, "fxjkzbaj", "风险监控->终本案件"),
    FXJK_BZXXX(59, "fxjkbzxxx", "风险监控->被执行信息"),

    /**
     * 风险监控-经营风险
     */
    JYFX_JYcjj(33, "jyfxjycjj", "风险监控->经营风险->经营异常"),
    JYFX_GSBG(34, "jyfxgsbg", "风险监控->经营风险->工商变更"),
    JYFX_YZWF(35, "jyfxyzwf", "风险监控->经营风险->严重违法"),
    JYFX_HBCF(38, "jyfxhbcf", "风险监控->经营风险->环保处罚"),
    JYFX_SSWF(36, "jyfxsswf", "风险监控->经营风险->税收违法"),
    JYFX_XZCF(37, "jyfxxzcf", "风险监控->经营风险->行政处罚"),

    /**
     * 业务管理
     */
    YWGL_ZWR(7, "ywglzwr", "业务管理->债务人"),
    YWGL_YWST(6, "ywglywst", "业务管理->业务视图"),
    YWGL_YWBGDC(60,"ywglywbgdc","业务管理->业务报告导出"),

    /**
     * 画像查询
     */
    HXCX(27, "hxcx", "画像查询"),

    /**
     * 信息搜索
     */
    XXSS_PMXX(12, "xxsspmxx", "信息搜索->拍卖信息"),
    XXSS_SSXX(13, "xxssssxx", "信息搜索->涉诉信息"),
    XXSS_WSXX(18, "xxsswsxx", "信息搜索->文书信息"),
    XXSS_JRZC(25, "xxssjrzc", "信息搜索->金融资产"),
    XXSS_PCCZ(28, "xxsspccz", "信息搜索->破产重组"),
    XXSS_SXJL(45, "xxsssxjl", "信息搜索->失信记录"),
    XXSS_TDSJ(46, "xxsstdsj", "信息搜索->土地数据"),
    XXSS_GQZY(47, "xxssgqzy", "信息搜索->股权质押"),
    XXSS_DCDY(48, "xxssdcdy", "信息搜索->动产抵押"),

    /**
     * 机构管理
     */
    JGGL_TSSZ(10, "jggltssz", "机构管理->推送设置"),
    JGGL_ZHLB(11, "jgglzhlb", "机构管理->账号列表"),
    JGGL_JGTJ(43, "jggljgtj", "机构管理->机构统计"),

    /**
     * 代理机构
     */
    DLJG(53, "dljg", "代理机构");

    private final Integer code;
    private final String alias;
    private final String title;

    /**
     * 资产监控权限
     */
    @ApiModelProperty("权限组")
    public static final Map<String, List<Integer>> IDS;

    static {
        Map<String, List<Integer>> map = new HashMap<>();
        map.put("zcwj", Arrays.asList(2,29,30,4,31,32,41,49,44,52,51,57));
        map.put("zjgc", Arrays.asList(54,55,56));
        map.put("fxjk", Arrays.asList(39,42,40,50,58,59));
        map.put("jyfx", Arrays.asList(33,34,35,36,37,38));
        map.put("ywgl", Arrays.asList(7,6,60));
        map.put("hxss", Arrays.asList(27));
        map.put("xxss", Arrays.asList(12,13,18,25,28,45,46,47,48));
        map.put("jggl", Arrays.asList(10,11,43));
        map.put("dljg", Arrays.asList(53));
        IDS = Collections.unmodifiableMap(map);
    }


    @Override
    public String toString() {
        return this.getTitle() + " : " + this.getCode();
    }
}